﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="OrderEventArgs.cs" company="">
//   
// </copyright>
// <summary>
//   The order status event args.
// </summary>
// --------------------------------------------------------------------------------------------------------------------


using System;

namespace Systemathics.FrameWork
{
    [Serializable]
    public sealed class OrderStatusEventArgs : EventArgs, ICloneable
    {
        public Guid OrderId { get; private set; }
        public OrderStatus Status { get; set; }
        public string Reason { get; set; }
        public int? RequestedQty { get; set; }
        public Decimal? RequestedPrice { get; set; }
        public int? RemainingQty { get; set; }
        public int? CanceledQty { get; set; }

        // Used For Back Test
        public DateTime SendTime { get; set; }
        public DateTime AckTime { get;  set; }
        public DateTime RejectTime { get;  set; }
        public DateTime CancelTime { get;  set; }
        public DateTime CancelAckTime { get;  set; }
        public DateTime ModifyTime { get;  set; }
        public DateTime ModifyAckTime { get;  set; }

        public OrderStatusEventArgs(Guid id)
        {
            OrderId = id;
        }
        public OrderStatusEventArgs(Guid id, OrderStatus status, int? requestedQty, Decimal? requestedPrice, int? remainingQty, int? canceledQty, string reason)
        { 
            OrderId = id;
            Status = status;
            RequestedQty = requestedQty;
            RequestedPrice = requestedPrice;
            RemainingQty = remainingQty;
            CanceledQty = canceledQty;
            Reason = reason;
        }

        #region ICloneable Members

        public object Clone()
        {
            return MemberwiseClone();
        }

        #endregion
    }

    [Serializable]
    public sealed class OrderExectutionEventArgs : EventArgs, ICloneable
    {
        public OrderExectutionEventArgs(Guid orderId, Decimal price, int quantity, string counterpart)
        {
            OrderId = orderId;
            Price = price;
            Quantity = quantity;
            Counterpart = counterpart;
        }

        public Guid OrderId { get; private set; }
        public Decimal Price { get; private set; }
        public int Quantity { get; private set; }
        public string Counterpart { get; private set; }

        #region ICloneable Members

        public object Clone()
        {
            return MemberwiseClone();
        }

        #endregion
    }
}